#include "sidlogger.h"

void SidLogger::log(const QString &log)
{
    if(state() != QAbstractSocket::ConnectedState) {
        return;
    }

    qDebug() << QString::fromUtf8("Enviando log %1!").arg(log);

    QByteArray block;
    QDataStream out(&block, QIODevice::WriteOnly);

    out << quint16(0) << QString("LOG") << log;
    out.device()->seek(0);
    out << quint16(block.size() - sizeof(quint16));
    write(block);
}
